package langnstats.project.languagemodel.loglinear;

import langnstats.project.lib.WordType;

public class ExistPunc extends LLFeature{
	
	private static final long serialVersionUID = 44L; 
	
	private int history=0;
	private String punc="no";
	
	public String getFeature(WordType token){
		String feature="";
		
		feature=punc;

		history++;
		
		if(token.getName().equals(WordType.COMMA.getName()) ||
				token.getName().equals(WordType.COLON.getName())){
			punc="yes";
		}
		
		if(token.getName().equals(WordType.PERIOD.getName())){
			rewind();
		}
		
		return "punc="+feature;
	}
	
	public void rewind(){
		history=0;
		punc="no";
	}
}
